<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>问答-KuangStudy</title>
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
    <style>
        .nav-underline .nav-link {
            padding-top: .75rem;
            padding-bottom: .75rem;
            font-size: .875rem;
            color: #6c757d;
        }
    </style>
</head>
<body style="background: #f2f2f2;">

<!-- 导航栏 -->
<main role="main" class="container mt-3 p-3 bg-white rounded">
    <div class="row">
        <div class="col-md-12 blog-main">
            <div class="col-md-12 order-md-1">
                <h4 class="mb-3">发布帖子</h4>

                <form class="needs-validation" th:action="@{/topic-info/input.do}" method="post">
                    <!-- 隐藏域 -->
                    <input type="hidden" name="userId" th:value="${session.loginUser.getUserId()}">
                    <input type="hidden" name="userName" th:value="${session.loginUser.getUserName()}">

                    <div class="row">
                        <div class="col-md-10 mb-3">
                            <label for="topicTitle">帖子标题</label>
                            <input type="text" name="topicTitle" class="form-control" id="topicTitle" value="" required>
                        </div>

                        <div class="col-md-2 mb-3">
                            <label for="country">帖子标签</label>
                            <select name="topicTypeId" class="custom-select d-block w-100" id="country">
                                <option th:each="category:${topicTypeList}"
                                        th:value="${category.getTypeId()}" th:text="${category.getTypeName()}">
                                </option>
                            </select>
                        </div>

                        <div class="col-md-12 mb-3">
                            <p>帖子内容</p>
                            <div id="blog-content">
                                <textarea required name="topicContent" id="topicContent"  rows="3" class="form-control"> </textarea>
                            </div>
                        </div>
                    </div>
                    <div>
                        <button class="btn btn-primary btn-sm btn-group" type="submit">发布</button>
                        <a th:href="@{/topic-info/showList}" class="btn btn-primary btn-sm btn-group">取消</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</main>

<a class="to-top">返回顶部</a>
<script th:src="@{/jquery/jquery-3.5.1.js}"></script>
<script th:src="@{/jquery/toTop.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>

<script type="text/javascript">

</script>

</body>
</html>